package com.bestom.bluetoothlock.util;

import android.util.Log;

public class LogUtils {
    private static boolean DEBUG = true;

    public static boolean isDEBUG() {
        return DEBUG;
    }

    public static void setDEBUG(boolean z) {
        if (z) {
            Log.i("Logs", "开启日志");
        } else {
            Log.i("Logs", "关闭日志");
        }
        DEBUG = z;
    }

    public static void e(String str, String str2) {
        if (DEBUG) {
            Log.e(str, str2);
            savaLog(str, str2);
        }
    }

    public static void e(String str, String str2, Exception exc) {
        if (DEBUG) {
            Log.e(str, str2, exc);
            savaLog(str, str2);
        }
    }

    public static void d(String str, String str2) {
        if (DEBUG) {
            Log.d(str, str2);
            savaLog(str, str2);
        }
    }

    public static void i(String str, String str2) {
        if (DEBUG) {
            Log.i(str, str2);
            savaLog(str, str2);
        }
    }

    public static void v(String str, String str2) {
        if (DEBUG) {
            Log.v(str, str2);
            savaLog(str, str2);
        }
    }

    public static void w(String str, String str2, Throwable th) {
        if (DEBUG) {
            Log.w(str, str2, th);
            savaLog(str, str2 + "\n Throwable:" + th.getMessage());
        }
    }

    public static void w(String str, String str2, Exception exc) {
        if (DEBUG) {
            Log.w(str, str2, exc);
            savaLog(str, str2 + "\n 错误:" + exc.getMessage());
        }
    }

    public static void w(String str, String str2) {
        if (DEBUG) {
            Log.w(str, str2);
            savaLog(str, str2);
        }
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(5:3|4|5|6|8) */
    /* JADX WARNING: Code restructure failed: missing block: B:10:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:9:?, code lost:
        return;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:5:0x0034 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static void savaLog(String r3, String r4) {
        /*
            com.lock.locksus.commons.utils.CurrencyDataManage r0 = com.lock.locksus.commons.utils.CurrencyDataManage.getInstance()
            boolean r0 = r0.isSavaLOG()
            if (r0 != 0) goto L_0x000b
            return
        L_0x000b:
            com.lock.locksus.commons.utils.ActivityUtils r0 = com.lock.locksus.commons.utils.ActivityUtils.getInstance()     // Catch:{ Exception -> 0x0034 }
            android.app.Activity r0 = r0.getActivity()     // Catch:{ Exception -> 0x0034 }
            com.lock.locksus.commons.utils.LogcatHelper r0 = com.lock.locksus.commons.utils.LogcatHelper.getInstance(r0)     // Catch:{ Exception -> 0x0034 }
            java.lang.StringBuilder r1 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x0034 }
            r1.<init>()     // Catch:{ Exception -> 0x0034 }
            java.lang.String r2 = "打印的TAG:"
            r1.append(r2)     // Catch:{ Exception -> 0x0034 }
            r1.append(r3)     // Catch:{ Exception -> 0x0034 }
            java.lang.String r2 = "\n\t日志的内容"
            r1.append(r2)     // Catch:{ Exception -> 0x0034 }
            r1.append(r4)     // Catch:{ Exception -> 0x0034 }
            java.lang.String r1 = r1.toString()     // Catch:{ Exception -> 0x0034 }
            r0.setLine(r1)     // Catch:{ Exception -> 0x0034 }
            goto L_0x0062
        L_0x0034:
            android.os.Looper.prepare()     // Catch:{ Exception -> 0x0062 }
            com.lock.locksus.commons.utils.ActivityUtils r0 = com.lock.locksus.commons.utils.ActivityUtils.getInstance()     // Catch:{ Exception -> 0x0062 }
            android.app.Activity r0 = r0.getActivity()     // Catch:{ Exception -> 0x0062 }
            com.lock.locksus.commons.utils.LogcatHelper r0 = com.lock.locksus.commons.utils.LogcatHelper.getInstance(r0)     // Catch:{ Exception -> 0x0062 }
            java.lang.StringBuilder r1 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x0062 }
            r1.<init>()     // Catch:{ Exception -> 0x0062 }
            java.lang.String r2 = "打印的TAG:"
            r1.append(r2)     // Catch:{ Exception -> 0x0062 }
            r1.append(r3)     // Catch:{ Exception -> 0x0062 }
            java.lang.String r3 = "\n\t日志的内容"
            r1.append(r3)     // Catch:{ Exception -> 0x0062 }
            r1.append(r4)     // Catch:{ Exception -> 0x0062 }
            java.lang.String r3 = r1.toString()     // Catch:{ Exception -> 0x0062 }
            r0.setLine(r3)     // Catch:{ Exception -> 0x0062 }
            android.os.Looper.loop()     // Catch:{ Exception -> 0x0062 }
        L_0x0062:
            return
        */
//        throw new UnsupportedOperationException("Method not decompiled: com.lock.locksus.commons.utils.LogUtils.savaLog(java.lang.String, java.lang.String):void");
    }
}
